package hash;

import org.apache.commons.codec.binary.Base64;
import org.junit.Test;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.security.Security;
import java.util.HashMap;

/**
 * @program: javaSE
 * @description: ${description}
 * @author: majian8
 * @create: 2019-07-15 14:10
 **/
public class Test2Hash {

    /**
     * HashMap,源码
     * https://www.jianshu.com/p/b0334fb09fcf
     */
    @Test
    public void test1() {

        Person p1=new Person();
        p1.setName("zhangshan");

        Person p2=new Person();
        p2.setName("lisi");
        //p1,p2 equals 方法不相等，hashCode()相等，模拟 hash冲突
        HashMap<Person,String> map=new HashMap<>();
        map.put(p1,p1.getName());
        map.put(p2,p2.getName());
        System.out.println();
    }


    @Test
    public void test() {

    }
}
